Skip to content

docs: add bearer auth server example#2602

Closed
MukundaKatta wants to merge 1 commit into
modelcontextprotocol:mainfrom
MukundaKatta:codex/document-bearer-auth-example
Closed

docs: add bearer auth server example#2602
MukundaKatta wants to merge 1 commit into
modelcontextprotocol:mainfrom
MukundaKatta:codex/document-bearer-auth-example

Conversation

@MukundaKatta
Copy link
Copy Markdown

Closes #431

  • add a runnable bearer-token auth server snippet using TokenVerifier
  • document that the verifier covers SSE and Streamable HTTP requests
  • show how tools can read the accepted token with get_access_token()

Checks:

  • python3 -m py_compile examples/snippets/servers/bearer_auth_server.py
  • git diff --check
  • python3 scripts/update_readme_snippets.py --readme README.v2.md --check
  • uv run ruff check examples/snippets/servers/bearer_auth_server.py

Note: python3 scripts/update_readme_snippets.py --readme README.md --check still reports an existing upstream missing snippet reference for examples/snippets/servers/fastmcp_quickstart.py, unrelated to this added example.

@maxisbey
Copy link
Copy Markdown
Contributor

Closing — README.md is frozen at v1 on main (a pre-commit hook rejects edits); the README.v2.md half of this change would be welcome in a fresh PR. See AGENTS.md for the branching model. Thanks for the contribution.

AI Disclaimer

@maxisbey maxisbey closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Question: How to authorise a client with Bearer header with SSE?

2 participants